package com.cyh.config;

import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Auther: cyh
 * @Date: 2022/5/23 21:12
 * @Description: EduConfig
 * @Version 1.0.0
 */

@Configuration
@MapperScan("com.cyh.mapper")    //扫描mapper包的地址
public class UserConfig {
    /*分页插件、...插件*/

    //1.逻辑删除插件
    @Bean
    public ISqlInjector sqlInjector() {
        return new LogicSqlInjector();
    }

    //2.分页插件
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
}
